import hyRequest from '@/service'

// 获取敏感词配置
export const getSensitiveConfig = () => {
  return hyRequest.get({
    url: '/sensitive/config/getConfig'
  })
}

// 更新敏感词配置
export const reqUpdateSensitiveConfig = (data: any) => {
  return hyRequest.put({
    url: `/sensitive/config`,
    data,
    isShowMessage: true
  })
}

// 在更新配置后，再调这个接口让配置生效
export const reqRefreshConfig = () => {
  return hyRequest.post({
    url: '/sensitive/config/refreshConfig'
  })
}

// 敏感词测试
export const getSensitiveWordTestRes = (text: string) => {
  return hyRequest.get({
    url: '/sensitive/config/sensitiveWordTest',
    params: { text }
  })
}
